﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using NHibernate.Cfg;
//using Fayson.BO;
using NHibernate.Tool.hbm2ddl;
using NHibernate;
//using Fayson.DAO;

namespace Fayson
{
    public partial class Form1 : Form
    {
        //private ISessionFactory m_SessionFactory;
        //private Configuration m_Cfg;

        public Form1()
        {
            InitializeComponent();
        }

        private void Init()
        {
            //var m_Cfg = new Configuration();
            //m_Cfg.Configure();
            //m_Cfg.AddAssembly(typeof(VAType).Assembly);
            //m_SessionFactory = m_Cfg.BuildSessionFactory();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            // Init();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //var vaType = new VAType{Name="ASDFsjkdfj", ChannelCount =4 };
            //IVATypeDAO dao = new VATypeDAO();
            //dao.Add(vaType);

            using (faysunEntities va = new faysunEntities())
            {
                Fayson.vatype t = new vatype();
                t.Name = "kasdjfk";
                t.ChannelCount = 3;
                va.AddTovatypes(t);
                va.SaveChanges();
            }

        }
    }
}
